package common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;

/**
 * Created by Administrator on 2017/5/18.
 */
public class FreemarkerGlobalParameter implements Interceptor{
    @Override
    public void intercept(Invocation invocation) {
        invocation.invoke();
        Controller controller = invocation.getController();
        controller.setAttr("basePath", controller.getRequest().getContextPath());
        System.out.println(controller.getRequest().getContextPath());
    }
}
